package com.esiag.bancs.sgbd;

import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;

import com.mysql.jdbc.Statement;

public class Test {
	public Test() {
		exp01();
	}
	
	void exp01() {
		
		DataSource ds = new DataSource(
				"com.mysql.jdbc.Driver", 
				"jdbc:mysql://localhost/stock", 
				"root", 
				""
		);
		Database db = new Database(ds);

		
		Calendar calendar1 = new GregorianCalendar();
		int heure1 = calendar1.get(java.util.Calendar.HOUR_OF_DAY);
		int minute1 = calendar1.get(java.util.Calendar.MINUTE);
		int seconde1 = calendar1.get(java.util.Calendar.SECOND);
		
		int i = 1000000000;
		while(i>0)
			{	
			db.selectTest();
			
		i=i-1;
			}
		
		Calendar calendar2 = new GregorianCalendar();
		int heure2 = calendar2.get(java.util.Calendar.HOUR_OF_DAY);
		int minute2 = calendar2.get(java.util.Calendar.MINUTE);
		int seconde2 = calendar2.get(java.util.Calendar.SECOND);
	
		System.out.println("heure : " + heure1 + " minute : "+ minute1+ " seconde : "+ seconde1);
		
		System.out.println("heure : " + heure2 + " minute : "+ minute2+ " seconde : "+ seconde2);
		
		
	}
	
	
	
	public static void main(String[] args) {
		new Test();
	}
}
